<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>Document</title>
        <script src="../vue.js"></script>
    </head>
    <body>
        <div id="app">
            <div v-abc>Hello</div>
        </div>
        <div id="vm">
            <div v-abc>World</div>
        </div>
        <script>
            // 全局注册
            Vue.directive('abc', {
                bind(el, binding, vNode) {
                    console.log(el);
                },
            });
            let vm = new Vue({
                el: '#app',
                data() {
                    return {};
                },
                methods: {},
            });
            new Vue({ el: '#vm' });
        </script>
    </body>
</html>
